package org.mrzc.service;

import org.mrzc.injection.IDAO;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class ServiceImpl implements IService, DisposableBean, InitializingBean
{
    private IDAO mDAO = null;

    public ServiceImpl()
    {
    }

    public ServiceImpl(IDAO DAO)
    {
        this.mDAO = DAO;
    }

    @Override
    public void save(String cValue)
    {
        mLog.debug("{}:{}->save({})", this.getClass().getSimpleName(), this.hashCode(), cValue);
        // cValue = cValue + ":" + this.hashCode();
        mDAO.save(cValue);
    }

    public void setDAO(IDAO cDAO)
    {
        this.mDAO = cDAO;
    }

    @Override
    public void afterPropertiesSet() throws Exception
    {
        mLog.debug("{}:{}->afterPropertiesSet()", this.getClass().getSimpleName());
    }

    @Override
    public void destroy() throws Exception
    {
        mLog.debug("{}:{}->destroy()", this.getClass().getSimpleName());
    }

}
